﻿using Architecture.Api.Application.Commands.CorporationCommand;
using Architecture.Domain.Services.Interface;
using Architecture.Domain.TraceabilityManage;
using MediatR;

namespace Architecture.Api.Application.CommandHandlers.CorporationHandler
{
    public class CorporationQueryInfoCommandHandler : IRequestHandler<CorporationQueryInfoCommand, Corporation>
    {
        private readonly ICultureService _cultureService;

        public CorporationQueryInfoCommandHandler(ICultureService cultureService)
        {
            _cultureService = cultureService;
        }

        public Task<Corporation> Handle(CorporationQueryInfoCommand request, CancellationToken cancellationToken)
        {
            return _cultureService.GetCorporationInfo(request.productionLot, request.parmId);
        }
    }
}
